<template>
	<view class="my-search-container" :style="{'background-color' : bgcolor}" @click="seaerchBoxHandler">
		<view class="my-search-box" :style="{'border-radius' : radius + 'px'}">
			<!-- <image src="../../../../static/search.png"></image> -->
			<uni-icons type="search" size="22"></uni-icons>
			<text class="placeholder">搜索</text>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			//背景颜色
			bgcolor : {
				type : String,
				default:'#C00000'
			},
			//圆角尺寸
			radius : {
				type:Number,
				default:18
			}
		},
		data(){
			return{
				
			}
		},
		methods:{
			seaerchBoxHandler(){
				// console.log(123456);
				this.$emit('click')//组件内部自定义事件，其他页面引用后，事件需要组件内部声明
			}
		}
	}
</script>

<style lang="scss">
	.my-search-container {
		height: 50px;
		// background-color: #C00000;
		display: flex;
		align-items: center;
		padding: 0 10px;

		.my-search-box {
			height: 36px;
			width: 100%;
			background-color: #FFFFFF;
			// border-radius: 15px;
			display: flex;
			justify-content: center;
			align-items: center;
			
			
			.placeholder {
				text-align: center;
				margin-left: 5px;
			}
		}
	}
</style>